package comunity;

public class UserData {
	private static UserData userData = null;
	private String username, password;
	private Status status;

	private UserData(String username, String password, Status status) {
		this.username = username;
		this.password = password;
		this.status = status;
	}

	public String getUsername() {
		synchronized (this) {
			return username;
		}
	}

	public String getPassword() {
		synchronized (this) {
			return password;
		}
	}

	public Status getStatus() {
		synchronized (this) {
			return status;
		}
	}

	public void setStatus(Status status) {
		synchronized (this) {
			this.status = status;
		}
	}

	public static void createUserData(String username, String password,
			Status status) {
		synchronized (userData) {
			userData = new UserData(username, password, status);
		}
	}

	public static UserData obtainUserData() {
		synchronized (userData) {
			return userData;
		}
	}
}
